# libmystdio.so:my_stdio.o my_string.o
# 	@gcc -o $@ $^ -shared 
# 	@echo "$^ to $@ ... done"
# %.o:%.c
# 	@gcc -c $< -fPIC
# 	@echo "$^ to $@ ... done"
# .PHONY:clean
# clean:
# 	@rm -rf *.txt a.out  *.o *.so stdc* ./other/*
# 	@echo "clean ... done"


# .PHONY:output
# output:
# 	@mkdir stdc
# 	@mkdir ./stdc/include
# 	@mkdir ./stdc/lib 
# 	@cp *.h ./stdc/include 
# 	@cp *.so ./stdc/lib 
# 	@tar -czf stdc.tgz stdc 
# 	@cp -r ./stdc.tgz ./other 
# 	@echo "output stdc.tgz ... done"
# 	@echo "cp stdc.tgz to other ... done"


##静态库
libmystdio.a:my_stdio.o my_string.o
	@ar -rc $@ $^
	@echo "$^ to $@ ... done"
%.o:%.c
	@gcc -c $<
	@echo "$^ to $@ ... done"
.PHONY:clean
clean:
	@rm -rf *.txt a.out  *.o *.a stdc* 
	@echo "clean ... done"
.PHONY:output
output:
	@mkdir stdc
	@mkdir ./stdc/include
	@mkdir ./stdc/lib 
	@cp *.h ./stdc/include 
	@cp *.a ./stdc/lib 
	@tar -czf stdc.tgz stdc 
	@cp -r ./stdc.tgz ./other 
	@echo "output stdc.tgz ... done"
	@echo "cp stdc.tgz to other ... done"
